body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f5f5f5;
    overflow: hidden;
}

.container {
    width: 100%;
    max-width: 800px;
    height: 100vh;
    margin: 0;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    text-align: center;
    font-family: 'Microsoft YaHei', sans-serif;
    background-color: rgba(255, 255, 255, 0.95);
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
    overflow-y: auto;
}

h1 {
    color: #333;
    margin: 10px 0;
}

.game-mode, .difficulty-selection, .theme-selection, .rules {
    margin: 20px auto;
    padding: 20px;
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    max-width: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.game-mode button, .difficulty-selection button {
    width: 200px;
    padding: 12px 24px;
    margin: 8px 0;
    font-size: 16px;
}

.theme-selection select {
    width: 200px;
    padding: 10px;
    margin: 8px 0;
    font-size: 14px;
    border-radius: 8px;
    border: 1px solid #ddd;
    background-color: white;
}

h2, h3 {
    color: #333;
    margin: 0 0 15px 0;
}

button {
    padding: 8px 16px;
    margin: 5px;
    font-size: 14px;
    cursor: pointer;
    border: none;
    border-radius: 8px;
    background-color: #4CAF50;
    color: white;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.game-area {
    margin: 5px 0;
}

#gameBoard {
    margin: 10px auto;
    display: block;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    max-width: 100%;
    max-height: 50vh;
    width: auto;
    height: auto;
    aspect-ratio: 1;
}

/* 主题样式 */
.theme-classic #gameBoard {
    background-color: #f0f0f0;
}

.theme-wooden #gameBoard {
    background-image: linear-gradient(#deb887, #d2691e);
}

.theme-colorful #gameBoard {
    background-image: linear-gradient(45deg, #ff6b6b, #4ecdc4);
}

.game-info {
    display: flex;
    justify-content: space-around;
    margin-bottom: 20px;
    font-size: 18px;
}

.game-controls {
    margin-top: 20px;
}

#undoButton {
    background-color: #ff9800;
}

#restartButton {
    background-color: #2196F3;
}

#backToMenu {
    background-color: #f44336;
}

/* 动画效果 */
@keyframes piecePlace {
    from {
        transform: scale(1.2);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.piece-animation {
    animation: piecePlace 0.3s ease-out;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
        flex-direction: column;
    }

    .game-mode, .difficulty-selection, .theme-selection, .rules {
        width: 100%;
        max-width: 100%;
        margin: 10px 0;
    }

    #gameBoard {
        width: 100%;
        height: auto;
    }

    .game-info {
        flex-direction: column;
        gap: 10px;
    }
}

/* 响应式设计 */
@media (orientation: landscape) {
    .container {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        align-items: flex-start;
        gap: 10px;
        padding: 10px;
    }

    h1 {
        width: 100%;
        margin: 5px 0;
    }

    .game-mode, .difficulty-selection, .theme-selection, .rules {
        flex: 1;
        min-width: 200px;
        margin: 5px;
    }

    .game-area {
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        align-items: center;
        gap: 10px;
    }

    .game-info {
        width: 100%;
        justify-content: center;
        gap: 20px;
    }

    #gameBoard {
        margin: 0;
        max-height: 70vh;
    }

    .game-controls {
        width: 100%;
        margin: 5px 0;
    }
}